/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package administrador;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public class TestBackup {

    public static void main(String[] args) {
        Backup b = new Backup();
        try {
//            byte[] data = b.getData("localhost", "3306", "root", "root", "dbmultiadmin").getBytes();
//            byte[] routine = b.getRoutine("localhost", "3306", "root", "root", "dbmultiadmin").getBytes();
            File filedst = new File("c:\\respaldo.zip");

            FileOutputStream dest = new FileOutputStream(filedst);
            ZipOutputStream zip = new ZipOutputStream(
                    new BufferedOutputStream(dest));
            zip.setMethod(ZipOutputStream.DEFLATED);
            zip.setLevel(Deflater.BEST_COMPRESSION);

            zip.putNextEntry(new ZipEntry("data.sql"));
//            zip.write(data);

            zip.putNextEntry(new ZipEntry("routine.sql"));
//            zip.write(routine);

            zip.close();
            dest.close();



        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }
}
